<?php

/**
 * Flickr Photosets - Slideshow Page
 * Displays the Flickr slideshow of a user's photoset or their photostream.
 * 
 * @author Brad Dougherty <bdougherty@gmail.com>
 * @version 8.4.11
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License 3.0
 */

/*
Require the function library
This will include all other necessary files
*/
require_once 'lib.php';

/*
Initialize Flickr Photosets and Flickr
*/
$fp = new FlickrPhotosetsCanvas(FlickrPhotosetsCanvas::uid_from_url);

// If this is for a set
if (isset($_GET['sid'])) {
	$photoset = $fp->flickr->photosets_getInfo($_GET['sid']);
	$title = $photoset['title'];
	$tab = 'photosets';
	
	$page_show_url = '/photos/'.$fp->config['flickr_nsid'].'/sets/'.$photoset['id'].'/show/';
	$page_show_back_url = $fp->canvas_url.'/photos/'.$fp->uid.'/sets/'.$photoset['id'];
	
	$flashvars = 'page_show_url='.$page_show_url;
	$flashvars .= '&amp;page_show_back_url='.$page_show_back_url;
	$flashvars .= '&amp;set_id='.$photoset['id'];
}
// If this is the photostream
else {
	$page_show_url = '/photos/'.$fp->config['flickr_nsid'].'/show/';
	$page_show_back_url = $fp->canvas_url.'/photos/'.$fp->uid.'/';
	
	$flashvars = 'page_show_url='.$page_show_url;
	$flashvars .= '&amp;page_show_back_url='.$page_show_back_url;
	$flashvars .= '&amp;user_id='.$fp->config['flickr_nsid'];
}

?>

<fb:title>Slideshow of <?=$title?></fb:title>
<?=$fp->get_stylesheet('photo')?>
<?=$fp->get_header($tab, $title)?>

<div id="show">
	
	<fb:swf swfsrc="http://www.flickr.com/apps/slideshow/show.swf?v=58979"
		flashvars="offsite=true&amp;intl_lang=en-us&amp;<?=$flashvars?>"
		width="760" height="570" />
	
	<?=$fp->echo_footer()?>
	
</div>